//
//  UITextField+Extension.m
//  代码适配
//
//  Created by 郭明皓 on 16/6/22.
//  Copyright © 2016年 郭明皓. All rights reserved.
//

#import "UITextField+Extension.h"

@implementation UITextField (Extension)
+(UITextField *)addTextFieldWithFrame:(CGRect)frame AndStr:(NSString *)placeholder AndFont:(CGFloat)font AndTextColor:(UIColor *)color andBordwith:(CGFloat)boreWith
{
    UITextField *textF=[[UITextField alloc]initWithFrame:frame];
    textF.userInteractionEnabled = YES;
    textF.textColor = color;
    textF.font =[UIFont systemFontOfSize:font*Width];
    textF.placeholder=placeholder;
    textF.layer.borderWidth = boreWith;
    return textF;
}

- (void)addplaceholder:(NSString *)str andColor:(UIColor *)color Textfield:(UITextField *)textfield
{
    UITextField *text = textfield;
    NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:str];
    [placeholder addAttribute:NSForegroundColorAttributeName
                        value:color
                        range:NSMakeRange(0, str.length)];
    text.attributedPlaceholder = placeholder;
}
@end
